<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf"><{$tit}>列表</div>
                </div>
                <div class="am-tabs am-margin-bottom">
                    <{tabTit1($tabtit)}>
                </div>
                <div class="widget-body am-fr">
                    <{if $tips}>
                    <div class="tips am-margin-bottom-sm am-u-sm-12">
                        <div class="pre">
                            <p> 1：</p>
                        </div>
                    </div>
                    <{/if}>
                    <!-- 工具栏 -->
                    <div class="page_toolbar am-margin-bottom-xs am-cf">
                        <{include file='admin/public/toolbar.php'}>
                    </div>
                    <div class="am-u-sm-12">
                        <form id="form-opid" method="post" action="">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                            <tr>
                                <th>
                                    <label class="am-checkbox-inline">
                                        <input type="checkbox" id="checkedAllBtn" data-am-ucheck />
                                        ID
                                    </label>
                                </th>
                                <th>名称</th>
                                <th>师傅</th>
                                <th>师傅排班</th>
                                <th>绑定科室</th>
                                <th>排序</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!empty($list)): foreach ($list as $val): ?>
                                <tr>
                                    <td class="am-text-middle">
                                        <label class="am-checkbox-inline">
                                            <input type="checkbox" name="opid[]" value="<?= $val['id'] ?>" data-am-ucheck />
                                            <?= $val['id'] ?>
                                        </label>
                                    </td>
                                    <td class="am-text-middle"><{if $val['name_h1']}><?= $val['name_h1'] ?><{else}><?= $val['name'] ?><{/if}></td>
                                    <td class="am-text-middle">
                                        <{if $val['shifu_ids']}>
                                        <?php foreach ( ids_to_arr($val['shifu_ids']) as $v): ?>
                                            <{$admins[$v]['realname']}>、
                                        <?php endforeach;?>
                                        <{/if}>
                                    </td>
                                    <td class="am-text-middle">
                                        <{if $val['parent_id']}>
                                        <div class="tpl-table-black-operation">
                                            <a href="#" class="item-shifu tpl-table-black-operation-green"
                                                data-id="<?= $val['id'] ?>">
                                                <i class="am-icon-undo"></i> 师傅排班
                                            </a>
                                        </div>
                                        <{/if}>
                                    </td>
                                    <td class="am-text-middle">
                                        <{if $val['parent_id']}>
                                        <div class="tpl-table-black-operation">
                                            <a href="#" class="item-keshi tpl-table-black-operation-green"
                                                data-id="<?= $val['id'] ?>">
                                                <i class="am-icon-undo"></i> 绑定科室
                                            </a>
                                        </div>
                                        <{/if}>
                                    </td>
                                    <td class="am-text-middle"><?= $val['sort'] ?></td>
                                    <td class="am-text-middle">
                                        <{include file=$m.'/public/act.php'}>
                                    </td>
                                    <td class="am-text-middle">
                                        <{include file=$m.'/public/edit.php'}>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="5" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                        </form>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <{$showPage nofilter}>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // open
        $('.item-shifu').open('id', "/<{$routeUrl}>/shifu", '师傅排班');
        // open
        $('.item-keshi').open('id', "/<{$routeUrl}>/keshi", '绑定科室');

    });
</script>

